import { SensitiveWordType } from '.';
import { WordListType } from './response';

export interface InfoProps {
  title: string;
  right?: string | React.ReactNode;
  type?: 'node' | 'input' | 'textarea';
  placeholder?: string;
  value?: string;
  change?: (key: string, value) => void;
  k?: string;
  textDirection?: 'left' | 'right';
  message?: string;
  onSubmit?: () => void;
}

export interface WordProps {
  size?: string | number;
  type: SensitiveWordType;
  reload?: () => void;
  item?: WordListType;
  select?: boolean;
  onChange?: (action: SensitiveWordType) => void;
  className?: string;
}

export interface TreeSelectItem {
  label: string;
  value: string;
}

export interface TreeSelectType {
  title: string;
  items: Array<TreeSelectItem>;
  kid: string;
}

export interface TreeSelectProps {
  titleWidth?: string | number;
  treeData?: Array<TreeSelectType>;
  value?: string | Array<string>;
  defaultCheckedKeys?: Array<number>;
  treeCheckable?: boolean;
  onChange?: (value: string) => void;
  onTabChange?: (value: string) => void;
  add?: boolean;
}

export interface SelectAvatarProps {
  size?: string | number;
  avatar?: string;
  change?: (value: string) => void;
}

export interface ShowUserInfoProps {
  size?: 'mini' | 'small' | 'medium' | 'large';
  shape?: 'square' | 'rounded' | 'circle';
  userID?: string | number;
  avatar?: string;
  showName?: boolean;
  username?: string;
}

export interface InputListProps {
  label: string;
  value?: string | React.ReactNode;
  setValue?: (v: string | string[]) => void;
  maxValue?: number;
  /**这里传true是自定义编辑*/
  edit?: boolean;
  rightHandler?: () => void;
  verify?: (v: string) => boolean;
  errMsg?: string;
  align?: 'center' | 'start' | 'end';
  ellipsis?: boolean;
  popup?: 'input' | 'picker' | 'phone' | 'email' | 'code';
  columns?: Array<{ label: string; value: string }>;
  defaultValue?: string | string[];
}
